home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Files / Standard File / StandardGetFolder / StandardGetFolderMain.c < prev   
Encoding:
C/C++ Source or Header  |  2000-09-28  |  1.9 KB  |  75 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        StandardGetFolderMain.c
  3.  
  4.     Contains:    A simple shell that allows the testing of the StandardGetFolder
  5.                  routines.
  6.  
  7.     Written by: Andy Bachorski    
  8.  
  9.     Copyright:    Copyright © 1998-1999 by Apple Computer, Inc., All Rights Reserved.
  10.  
  11.                 You may incorporate this Apple sample source code into your program(s) without
  12.                 restriction. This Apple sample source code has been provided "AS IS" and the
  13.                 responsibility for its operation is yours. You are not permitted to redistribute
  14.                 this Apple sample source code as "Apple sample source code" after having made
  15.                 changes. If you're going to re-distribute the source, we require that you make
  16.                 it clear in the source that the code was descended from Apple sample source
  17.                 code, but that you've made changes.
  18.  
  19.     Change History (most recent first):
  20.                 7/1/1999    Karl Groethe         Updated for Metrowerks Codewarror Pro 2.1
  21.                 
  22.  
  23. */
  24.  
  25. //******************    Universal Interfaces        ****************************
  26.  
  27. #include <Dialogs.h>
  28. #include <Finder.h>
  29. #include <Fonts.h>
  30. #include <Menus.h>
  31. #include <Quickdraw.h>
  32. #include <TextEdit.h>
  33.  
  34.  
  35. //******************    Project Interfaces            ****************************
  36.  
  37. #include "StandardGetFolder.h"
  38.  
  39. void main(void)
  40. {
  41.     FileFilterYDUPP     customFilterUPP;
  42.     StandardFileReply    mySFReply;
  43.     
  44.     // init the toolbox
  45.     
  46.     MaxApplZone();
  47.     InitGraf(&qd.thePort);
  48.     InitFonts();
  49.     InitWindows(); 
  50.     InitMenus();
  51.     TEInit();
  52.     InitDialogs(nil);
  53.  
  54.     //    Call the get folder routine, passing in our file filter
  55.     
  56.     customFilterUPP = NewFileFilterYDProc( OnlyVisibleFoldersCustomFileFilter );
  57.  
  58.     StandardGetFolder( customFilterUPP, &mySFReply );
  59.     
  60.     DisposeRoutineDescriptor( customFilterUPP );
  61.     
  62.     // MacsBug is indeed the best UI for reporting results
  63.     /*
  64.         if (mySFReply.sfGood)
  65.         {
  66.             DebugStr(mySFReply.sfFile.name);
  67.             
  68.             if (mySFReply.sfIsVolume) DebugStr("\p is a volume");
  69.         }
  70.         else
  71.         {
  72.             DebugStr("\p cancelled");
  73.         }
  74.     */
  75. }